<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<script type="text/javascript" src="/${initParam.context_root }/script/cscenter.js"></script>
<script type="text/javascript">
function cancelForm(){
	var f1 = window.document.form_name;
	//f1.action="/${initParam.context_root }/cscenter/login/getContentBack.do?no=${requestScope.cscenter.cscenterNo }&page=${requestScope.page }&divide=${requestScope.cscenter.divide }";
	f1.action="/${initParam.context_root }/cscenter/login/getContentBack.do?no=${requestScope.cscenter.cscenterNo }&page=${requestScope.page }";
	f1.submit();
}
</script>
<div class="container">
	<div class="starter-template" style="padding-right: 40px; padding-top: 40px; padding-bottom: 80px">
		<div class="alert alert-info" style="width: 800px; margin: auto">이곳은 ${requestScope.divideText }을 수정하는 곳입니다.</div>
		<br>
		<%-- <h1>${requestScope.divideText }</h1> --%>
		<h4>${requestScope.divideTextSub }</h4>
		<!-- <h3>글수정</h3> -->
		<div class="well" style="width: 800px; margin: auto">
			<form name="form_name" action="/${initParam.context_root }/cscenter/login/modifyContent.do" method="post"
				onsubmit="return writeFormCheck(this);" role="form">
				<input type="hidden" name="cscenterNo" value="${requestScope.cscenter.cscenterNo }">
				<input type="hidden" name="nickname" value="${sessionScope.login_info.nickname }">
				<%-- <input type="hidden" name="email" value="${sessionScope.login_info.email }"> --%>
				<input type="hidden" name="divide" value="${requestScope.cscenter.divide }">
				<input type="hidden" name="page" value="${requestScope.page }">
				
				<div class="form-group">
					<label for="title">제목</label><input type="text" class="form-control" id="subject" name="title" size="70"
					 value="${requestScope.cscenter.title }">
				</div>
				<div class="form-group">
					<label for="nickname">작성자 : </label>
					${requestScope.cscenter.nickname }
					<%-- <input type="text" id="nickname" name="nickname"
					class="form-control" value="${requestScope.cscenter.nickname }"> --%>
				</div>
				<c:if test="${requestScope.cscenter.divide=='7'&&sessionScope.login_info.id==requestScope.cscenter.id}">
					<label for="nickname">수신 이메일 : </label>
					<input type="text" class="form-control" name="email" id="email" value="${sessionScope.login_info.email }">
				</c:if>
				
				<textarea cols="100" rows="15" class="form-control" name="content">${requestScope.cscenter.content }</textarea>
				<br>
				<br>
				
				<button type="button" class="btn btn-warning" onclick="return cancelForm();">취소</button>
				<button type="submit" class="btn btn-primary">수정</button>
				<button type="reset" class="btn btn-danger" onclick="return resetForm();">초기화</button>
			</form>
		</div>
	</div>
</div>
